using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.IO;

using OrbitOne.Feed.Domain;
using OrbitOne.Feed.Interfaces;

namespace OrbitOne.Feed.Handlers {

    class HandlerFactory : IHttpHandlerFactory {
        
        public IHttpHandler GetHandler(
            HttpContext context, 
            String requestType, 
            String url, 
            String pathTranslated) {

            String path = context.Request.PhysicalPath;

            if (Path.GetExtension(path) == ".rss") {
                return new RSSHandler();
            }
            if (Path.GetExtension(path) == ".atom") {
                return new ATOMHandler();
            }
            return null;
        }

        public void ReleaseHandler(IHttpHandler handler) {
        }

    }
}
